K.

provides("K.lang.Function").
run(function(I) {
    
    var Function = K.kin(function(o) {
            throw I.provides + " | Cannot instantiate";
        }),
        
        ZERO = "0";
    
    K.merge(Function, {
        overload : function() {
            var functions = {};
            K.array(arguments).forEach(function(f) {
                var l = String(f.length);
                if (l in functions) {
                    throw I.provides + " | [overload] All functions must have different parameter length";
                }
                
                functions[l] = f;
            });
            
            return function() {
                var l = String(arguments.length),
                    args = K.array(arguments);
                    
                if (l in functions) {
                    return functions[l].apply(this, args);
                } else if (ZERO in functions) {
                    return functions[ZERO].apply(this, args); 
                } else {
                    throw I.provides + " | [overload] Unsupported arguments length";
                }
            }
        }
    });
    
    return Function;
});